home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / sbprolog / amiga / v3_1 / sbp3_1e.lzh / PARSER2.PL < prev    next >
Text File  |  1991-10-31  |  714b  |  31 lines

  1. /* From the book PROLOG PROGRAMMING IN DEPTH
  2.    by Michael A. Covington, Donald Nute, and Andre Vellino.
  3.    Copyright 1988 Scott, Foresman & Co.
  4.    Non-commercial distribution of this file is permitted. */
  5. /* Modified for Quintus Prolog by Andreas Siebert */
  6.  
  7. /* PARSER2.PL */
  8. /* Like PARSER1.PL, but uses grammar rule notation. */
  9.  
  10. /* Queries will use the built-in predicate phrase/2 */
  11.  
  12. sentence --> noun_phrase, verb_phrase.
  13.  
  14. noun_phrase --> determiner, noun.
  15.  
  16. verb_phrase --> verb, noun_phrase.
  17. verb_phrase --> verb, sentence.
  18.  
  19. determiner --> [the].
  20. determiner --> [a].
  21.  
  22. noun --> [dog].
  23. noun --> [cat].
  24. noun --> [boy].
  25. noun --> [girl].
  26.  
  27. verb --> [chased].
  28. verb --> [saw].
  29. verb --> [said].
  30. verb --> [believed].
  31.